package org.jivesoftware.smackx.workgroup.user;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.AndFilter;
import org.jivesoftware.smack.filter.FromContainsFilter;
import org.jivesoftware.smack.filter.PacketFilter;
import org.jivesoftware.smack.filter.PacketIDFilter;
import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.IQ.Type;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Type;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smackx.Form;
import org.jivesoftware.smackx.FormField;
import org.jivesoftware.smackx.ServiceDiscoveryManager;
import org.jivesoftware.smackx.muc.InvitationListener;
import org.jivesoftware.smackx.muc.MultiUserChat;
import org.jivesoftware.smackx.packet.DataForm;
import org.jivesoftware.smackx.packet.DiscoverInfo;
import org.jivesoftware.smackx.packet.MUCUser;
import org.jivesoftware.smackx.packet.MUCUser.Invite;
import org.jivesoftware.smackx.workgroup.MetaData;
import org.jivesoftware.smackx.workgroup.WorkgroupInvitation;
import org.jivesoftware.smackx.workgroup.WorkgroupInvitationListener;
import org.jivesoftware.smackx.workgroup.ext.forms.WorkgroupForm;
import org.jivesoftware.smackx.workgroup.packet.DepartQueuePacket;
import org.jivesoftware.smackx.workgroup.packet.QueueUpdate;
import org.jivesoftware.smackx.workgroup.packet.SessionID;
import org.jivesoftware.smackx.workgroup.packet.UserID;
import org.jivesoftware.smackx.workgroup.settings.ChatSetting;
import org.jivesoftware.smackx.workgroup.settings.ChatSettings;
import org.jivesoftware.smackx.workgroup.settings.OfflineSettings;
import org.jivesoftware.smackx.workgroup.settings.SoundSettings;
import org.jivesoftware.smackx.workgroup.settings.WorkgroupProperties;

public class Workgroup
{
  private Connection connection;
  private boolean inQueue;
  private List invitationListeners;
  private List queueListeners;
  private int queuePosition = -1;
  private int queueRemainingTime = -1;
  private List siteInviteListeners;
  private String workgroupJID;

  public Workgroup(String paramString, Connection paramConnection)
  {
    if (!(paramConnection.isAuthenticated()))
      throw new IllegalStateException("Must login to server before creating workgroup.");
    this.workgroupJID = paramString;
    this.connection = paramConnection;
    this.inQueue = false;
    this.invitationListeners = new ArrayList();
    this.queueListeners = new ArrayList();
    this.siteInviteListeners = new ArrayList();
    addQueueListener(new QueueListener(this)
    {
      public void departedQueue()
      {
        Workgroup.access$1(this.this$0, false);
        Workgroup.access$2(this.this$0, -1);
        Workgroup.access$3(this.this$0, -1);
      }

      public void joinedQueue()
      {
        Workgroup.access$1(this.this$0, true);
      }

      public void queuePositionUpdated()
      {
        Workgroup.access$2(this.this$0, paramInt);
      }

      public void queueWaitTimeUpdated()
      {
        Workgroup.access$3(this.this$0, paramInt);
      }
    });
    MultiUserChat.addInvitationListener(paramConnection, new InvitationListener(this)
    {
      public void invitationReceived(, String paramString1, String paramString2, String paramString3, String paramString4, Message paramMessage)
      {
        Workgroup.access$1(this.this$0, false);
        Workgroup.access$2(this.this$0, -1);
        Workgroup.access$3(this.this$0, -1);
      }
    });
    PacketTypeFilter localPacketTypeFilter = new PacketTypeFilter(Message.class);
    paramConnection.addPacketListener(new PacketListener(this)
    {
      public void processPacket()
      {
        Workgroup.access$4(this.this$0, paramPacket);
      }
    }
    , localPacketTypeFilter);
  }

  // ERROR //
  private void fireInvitationEvent(WorkgroupInvitation paramWorkgroupInvitation)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 59	org/jivesoftware/smackx/workgroup/user/Workgroup:invitationListeners	Ljava/util/List;
    //   4: astore_2
    //   5: aload_2
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 59	org/jivesoftware/smackx/workgroup/user/Workgroup:invitationListeners	Ljava/util/List;
    //   11: invokeinterface 110 1 0
    //   16: astore 4
    //   18: aload 4
    //   20: invokeinterface 115 1 0
    //   25: ifne +6 -> 31
    //   28: aload_2
    //   29: monitorexit
    //   30: return
    //   31: aload 4
    //   33: invokeinterface 119 1 0
    //   38: checkcast 121	org/jivesoftware/smackx/workgroup/WorkgroupInvitationListener
    //   41: aload_1
    //   42: invokeinterface 124 2 0
    //   47: goto -29 -> 18
    //   50: astore_3
    //   51: aload_2
    //   52: monitorexit
    //   53: aload_3
    //   54: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   7	53	50	finally
  }

  // ERROR //
  private void fireQueueDepartedEvent()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   4: astore_1
    //   5: aload_1
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   11: invokeinterface 110 1 0
    //   16: astore_3
    //   17: aload_3
    //   18: invokeinterface 115 1 0
    //   23: ifne +6 -> 29
    //   26: aload_1
    //   27: monitorexit
    //   28: return
    //   29: aload_3
    //   30: invokeinterface 119 1 0
    //   35: checkcast 127	org/jivesoftware/smackx/workgroup/user/QueueListener
    //   38: invokeinterface 130 1 0
    //   43: goto -26 -> 17
    //   46: astore_2
    //   47: aload_1
    //   48: monitorexit
    //   49: aload_2
    //   50: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   7	49	46	finally
  }

  // ERROR //
  private void fireQueueJoinedEvent()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   4: astore_1
    //   5: aload_1
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   11: invokeinterface 110 1 0
    //   16: astore_3
    //   17: aload_3
    //   18: invokeinterface 115 1 0
    //   23: ifne +6 -> 29
    //   26: aload_1
    //   27: monitorexit
    //   28: return
    //   29: aload_3
    //   30: invokeinterface 119 1 0
    //   35: checkcast 127	org/jivesoftware/smackx/workgroup/user/QueueListener
    //   38: invokeinterface 134 1 0
    //   43: goto -26 -> 17
    //   46: astore_2
    //   47: aload_1
    //   48: monitorexit
    //   49: aload_2
    //   50: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   7	49	46	finally
  }

  // ERROR //
  private void fireQueuePositionEvent(int paramInt)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   4: astore_2
    //   5: aload_2
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   11: invokeinterface 110 1 0
    //   16: astore 4
    //   18: aload 4
    //   20: invokeinterface 115 1 0
    //   25: ifne +6 -> 31
    //   28: aload_2
    //   29: monitorexit
    //   30: return
    //   31: aload 4
    //   33: invokeinterface 119 1 0
    //   38: checkcast 127	org/jivesoftware/smackx/workgroup/user/QueueListener
    //   41: iload_1
    //   42: invokeinterface 139 2 0
    //   47: goto -29 -> 18
    //   50: astore_3
    //   51: aload_2
    //   52: monitorexit
    //   53: aload_3
    //   54: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   7	53	50	finally
  }

  // ERROR //
  private void fireQueueTimeEvent(int paramInt)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   4: astore_2
    //   5: aload_2
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 61	org/jivesoftware/smackx/workgroup/user/Workgroup:queueListeners	Ljava/util/List;
    //   11: invokeinterface 110 1 0
    //   16: astore 4
    //   18: aload 4
    //   20: invokeinterface 115 1 0
    //   25: ifne +6 -> 31
    //   28: aload_2
    //   29: monitorexit
    //   30: return
    //   31: aload 4
    //   33: invokeinterface 119 1 0
    //   38: checkcast 127	org/jivesoftware/smackx/workgroup/user/QueueListener
    //   41: iload_1
    //   42: invokeinterface 143 2 0
    //   47: goto -29 -> 18
    //   50: astore_3
    //   51: aload_2
    //   52: monitorexit
    //   53: aload_3
    //   54: athrow
    //
    // Exception table:
    //   from	to	target	type
    //   7	53	50	finally
  }

  private ChatSettings getChatSettings(String paramString, int paramInt)
    throws XMPPException
  {
    ChatSettings localChatSettings1 = new ChatSettings();
    if (paramString != null)
      localChatSettings1.setKey(paramString);
    if (paramInt != -1)
      localChatSettings1.setType(paramInt);
    localChatSettings1.setType(IQ.Type.GET);
    localChatSettings1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localChatSettings1.getPacketID()));
    this.connection.sendPacket(localChatSettings1);
    ChatSettings localChatSettings2 = (ChatSettings)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localChatSettings2 == null)
      throw new XMPPException("No response from server.");
    if (localChatSettings2.getError() != null)
      throw new XMPPException(localChatSettings2.getError());
    return localChatSettings2;
  }

  private void handlePacket(Packet paramPacket)
  {
    Message localMessage;
    PacketExtension localPacketExtension2;
    MUCUser.Invite localInvite;
    if (paramPacket instanceof Message)
    {
      localMessage = (Message)paramPacket;
      PacketExtension localPacketExtension1 = localMessage.getExtension("depart-queue", "http://jabber.org/protocol/workgroup");
      localPacketExtension2 = localMessage.getExtension("queue-status", "http://jabber.org/protocol/workgroup");
      if (localPacketExtension1 == null)
        break label40;
      fireQueueDepartedEvent();
    }
    while (true)
    {
      label40: QueueUpdate localQueueUpdate;
      do
      {
        return;
        if (localPacketExtension2 == null)
          break label93;
        localQueueUpdate = (QueueUpdate)localPacketExtension2;
        if (localQueueUpdate.getPosition() != -1)
          fireQueuePositionEvent(localQueueUpdate.getPosition());
      }
      while (localQueueUpdate.getRemaingTime() == -1);
      fireQueueTimeEvent(localQueueUpdate.getRemaingTime());
    }
    label93: MUCUser localMUCUser = (MUCUser)localMessage.getExtension("x", "http://jabber.org/protocol/muc#user");
    if (localMUCUser != null)
      localInvite = localMUCUser.getInvite();
    while (true)
    {
      while (true)
      {
        if ((localInvite == null) || (!(this.workgroupJID.equals(localInvite.getFrom()))));
        String str = null;
        Map localMap = null;
        PacketExtension localPacketExtension3 = localMessage.getExtension("session", "http://jivesoftware.com/protocol/workgroup");
        if (localPacketExtension3 != null)
          str = ((SessionID)localPacketExtension3).getSessionID();
        PacketExtension localPacketExtension4 = localMessage.getExtension("metadata", "http://jivesoftware.com/protocol/workgroup");
        if (localPacketExtension4 != null)
          localMap = ((MetaData)localPacketExtension4).getMetaData();
        fireInvitationEvent(new WorkgroupInvitation(this.connection.getUser(), localMessage.getFrom(), this.workgroupJID, str, localMessage.getBody(), localMessage.getFrom(), localMap));
      }
      localInvite = null;
    }
  }

  public void addInvitationListener(WorkgroupInvitationListener paramWorkgroupInvitationListener)
  {
    synchronized (this.invitationListeners)
    {
      if (!(this.invitationListeners.contains(paramWorkgroupInvitationListener)))
        this.invitationListeners.add(paramWorkgroupInvitationListener);
      return;
    }
  }

  public void addQueueListener(QueueListener paramQueueListener)
  {
    synchronized (this.queueListeners)
    {
      if (!(this.queueListeners.contains(paramQueueListener)))
        this.queueListeners.add(paramQueueListener);
      return;
    }
  }

  public void departQueue()
    throws XMPPException
  {
    if (!(this.inQueue));
    while (true)
    {
      return;
      DepartQueuePacket localDepartQueuePacket = new DepartQueuePacket(this.workgroupJID);
      PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localDepartQueuePacket.getPacketID()));
      this.connection.sendPacket(localDepartQueuePacket);
      IQ localIQ = (IQ)localPacketCollector.nextResult(5000L);
      localPacketCollector.cancel();
      if (localIQ == null)
        throw new XMPPException("No response from the server.");
      if (localIQ.getError() != null)
        throw new XMPPException(localIQ.getError());
      fireQueueDepartedEvent();
    }
  }

  public ChatSetting getChatSetting(String paramString)
    throws XMPPException
  {
    return getChatSettings(paramString, -1).getFirstEntry();
  }

  public ChatSettings getChatSettings()
    throws XMPPException
  {
    return getChatSettings(null, -1);
  }

  public ChatSettings getChatSettings(int paramInt)
    throws XMPPException
  {
    return getChatSettings(null, paramInt);
  }

  public OfflineSettings getOfflineSettings()
    throws XMPPException
  {
    OfflineSettings localOfflineSettings1 = new OfflineSettings();
    localOfflineSettings1.setType(IQ.Type.GET);
    localOfflineSettings1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localOfflineSettings1.getPacketID()));
    this.connection.sendPacket(localOfflineSettings1);
    OfflineSettings localOfflineSettings2 = (OfflineSettings)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localOfflineSettings2 == null)
      throw new XMPPException("No response from server.");
    if (localOfflineSettings2.getError() != null)
      throw new XMPPException(localOfflineSettings2.getError());
    return localOfflineSettings2;
  }

  public int getQueuePosition()
  {
    return this.queuePosition;
  }

  public int getQueueRemainingTime()
  {
    return this.queueRemainingTime;
  }

  public SoundSettings getSoundSettings()
    throws XMPPException
  {
    SoundSettings localSoundSettings1 = new SoundSettings();
    localSoundSettings1.setType(IQ.Type.GET);
    localSoundSettings1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localSoundSettings1.getPacketID()));
    this.connection.sendPacket(localSoundSettings1);
    SoundSettings localSoundSettings2 = (SoundSettings)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localSoundSettings2 == null)
      throw new XMPPException("No response from server.");
    if (localSoundSettings2.getError() != null)
      throw new XMPPException(localSoundSettings2.getError());
    return localSoundSettings2;
  }

  public Form getWorkgroupForm()
    throws XMPPException
  {
    WorkgroupForm localWorkgroupForm1 = new WorkgroupForm();
    localWorkgroupForm1.setType(IQ.Type.GET);
    localWorkgroupForm1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localWorkgroupForm1.getPacketID()));
    this.connection.sendPacket(localWorkgroupForm1);
    WorkgroupForm localWorkgroupForm2 = (WorkgroupForm)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localWorkgroupForm2 == null)
      throw new XMPPException("No response from server on status set.");
    if (localWorkgroupForm2.getError() != null)
      throw new XMPPException(localWorkgroupForm2.getError());
    return Form.getFormFrom(localWorkgroupForm2);
  }

  public String getWorkgroupJID()
  {
    return this.workgroupJID;
  }

  public WorkgroupProperties getWorkgroupProperties()
    throws XMPPException
  {
    WorkgroupProperties localWorkgroupProperties1 = new WorkgroupProperties();
    localWorkgroupProperties1.setType(IQ.Type.GET);
    localWorkgroupProperties1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localWorkgroupProperties1.getPacketID()));
    this.connection.sendPacket(localWorkgroupProperties1);
    WorkgroupProperties localWorkgroupProperties2 = (WorkgroupProperties)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localWorkgroupProperties2 == null)
      throw new XMPPException("No response from server.");
    if (localWorkgroupProperties2.getError() != null)
      throw new XMPPException(localWorkgroupProperties2.getError());
    return localWorkgroupProperties2;
  }

  public WorkgroupProperties getWorkgroupProperties(String paramString)
    throws XMPPException
  {
    WorkgroupProperties localWorkgroupProperties1 = new WorkgroupProperties();
    localWorkgroupProperties1.setJid(paramString);
    localWorkgroupProperties1.setType(IQ.Type.GET);
    localWorkgroupProperties1.setTo(this.workgroupJID);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localWorkgroupProperties1.getPacketID()));
    this.connection.sendPacket(localWorkgroupProperties1);
    WorkgroupProperties localWorkgroupProperties2 = (WorkgroupProperties)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localWorkgroupProperties2 == null)
      throw new XMPPException("No response from server.");
    if (localWorkgroupProperties2.getError() != null)
      throw new XMPPException(localWorkgroupProperties2.getError());
    return localWorkgroupProperties2;
  }

  public boolean isAvailable()
  {
    int i;
    Presence localPresence1 = new Presence(Presence.Type.available);
    localPresence1.setTo(this.workgroupJID);
    PacketTypeFilter localPacketTypeFilter = new PacketTypeFilter(Presence.class);
    FromContainsFilter localFromContainsFilter = new FromContainsFilter(this.workgroupJID);
    Connection localConnection = this.connection;
    PacketFilter[] arrayOfPacketFilter = new PacketFilter[2];
    arrayOfPacketFilter[0] = localFromContainsFilter;
    arrayOfPacketFilter[1] = localPacketTypeFilter;
    PacketCollector localPacketCollector = localConnection.createPacketCollector(new AndFilter(arrayOfPacketFilter));
    this.connection.sendPacket(localPresence1);
    Presence localPresence2 = (Presence)localPacketCollector.nextResult(SmackConfiguration.getPacketReplyTimeout());
    localPacketCollector.cancel();
    if (localPresence2 == null)
      i = 0;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          return i;
          if (localPresence2.getError() == null)
            break;
          i = 0;
        }
        if (Presence.Type.available != localPresence2.getType())
          break;
        i = 1;
      }
      i = 0;
    }
  }

  public boolean isEmailAvailable()
  {
    boolean bool1;
    ServiceDiscoveryManager localServiceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(this.connection);
    try
    {
      boolean bool2 = localServiceDiscoveryManager.discoverInfo(StringUtils.parseServer(this.workgroupJID)).containsFeature("jive:email:provider");
      bool1 = bool2;
      return bool1;
    }
    catch (XMPPException localXMPPException)
    {
      bool1 = false;
    }
  }

  public boolean isInQueue()
  {
    return this.inQueue;
  }

  public void joinQueue()
    throws XMPPException
  {
    joinQueue(null);
  }

  public void joinQueue(Map paramMap, String paramString)
    throws XMPPException
  {
    if (this.inQueue)
      throw new IllegalStateException("Already in queue " + this.workgroupJID);
    Form localForm = new Form("submit");
    Iterator localIterator = paramMap.keySet().iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        joinQueue(localForm, paramString);
        return;
      }
      String str1 = (String)localIterator.next();
      String str2 = paramMap.get(str1).toString();
      String str3 = StringUtils.escapeForXML(str1);
      String str4 = StringUtils.escapeForXML(str2);
      FormField localFormField = new FormField(str3);
      localFormField.setType("text-single");
      localForm.addField(localFormField);
      localForm.setAnswer(str3, str4);
    }
  }

  public void joinQueue(Form paramForm)
    throws XMPPException
  {
    joinQueue(paramForm, null);
  }

  public void joinQueue(Form paramForm, String paramString)
    throws XMPPException
  {
    if (this.inQueue)
      throw new IllegalStateException("Already in queue " + this.workgroupJID);
    JoinQueuePacket localJoinQueuePacket = new JoinQueuePacket(this, this.workgroupJID, paramForm, paramString);
    PacketCollector localPacketCollector = this.connection.createPacketCollector(new PacketIDFilter(localJoinQueuePacket.getPacketID()));
    this.connection.sendPacket(localJoinQueuePacket);
    IQ localIQ = (IQ)localPacketCollector.nextResult(10000L);
    localPacketCollector.cancel();
    if (localIQ == null)
      throw new XMPPException("No response from the server.");
    if (localIQ.getError() != null)
      throw new XMPPException(localIQ.getError());
    fireQueueJoinedEvent();
  }

  public void removeQueueListener(WorkgroupInvitationListener paramWorkgroupInvitationListener)
  {
    synchronized (this.invitationListeners)
    {
      this.invitationListeners.remove(paramWorkgroupInvitationListener);
      return;
    }
  }

  public void removeQueueListener(QueueListener paramQueueListener)
  {
    synchronized (this.queueListeners)
    {
      this.queueListeners.remove(paramQueueListener);
      return;
    }
  }

  private class JoinQueuePacket extends IQ
  {
    private DataForm form;
    private String userID = null;

    public JoinQueuePacket(, String paramString1, Form paramForm, String paramString2)
    {
      this.userID = paramString2;
      setTo(paramString1);
      setType(IQ.Type.SET);
      this.form = paramForm.getDataFormToSend();
      addExtension(this.form);
    }

    public String getChildElementXML()
    {
      StringBuilder localStringBuilder = new StringBuilder();
      localStringBuilder.append("<join-queue xmlns=\"http://jabber.org/protocol/workgroup\">");
      localStringBuilder.append("<queue-notifications/>");
      if (Workgroup.access$0(this.this$0).isAnonymous())
        localStringBuilder.append(new UserID(this.userID).toXML());
      localStringBuilder.append(this.form.toXML());
      localStringBuilder.append("</join-queue>");
      return localStringBuilder.toString();
    }
  }
}